package org.jeecg.modules.wo.utils;

import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.jeecg.modules.wo.people.service.IWoPeopleService;
import org.jeecg.modules.wo.wobasepeople.service.IWoBasePeopleService;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 获取核酸检测记录 定时任务
 */
@Slf4j
public class InspJob implements Job {
    @Autowired
    private IWoPeopleService woPeopleService;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        String apiModel="device";
        Integer day=0;
        try {
            JobDataMap paramMap=context.getMergedJobDataMap();//jobDataMap
            String paramsStr=paramMap.getString("parameter");
            if(StringUtils.isNotBlank(paramsStr)){
                String[] params=paramsStr.split(",");
                apiModel=params[0];
                if(params.length>1){
                    day=Integer.valueOf(params[1]);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        woPeopleService.getNucleicByType(apiModel,"",day);
    }

}
